package hashsset;

import java.util.HashSet;
import java.util.Iterator;

public class Stu_hash {

    public static void main(String[] args) {
        HashSet<Student> stu=new HashSet<Student>();
     Student s1=new Student("rose",19);
        Student s2=new Student("yuxiang",28);
        Student s3=new Student("jack",32);

        stu.add(s1);
        stu.add(s2);
        Iterator iterator=stu.iterator();
        while (iterator.hasNext())
        {
            System.out.println(iterator.next());
        }


    }




}
